#include <iostream>
#include <cmath>
using namespace std;
int main(int argc, char **argv[])
{
  double x1, y1, x2, y2, x3, y3, a, b, c, p, S;
  cout << "vvedite koordinati pervoy vershini x1 i y1: ";
  cin >> x1 >> y1;
  cout << "vvedite koordinati vtoroi vershini x2 i y2: ";
  cin >> x2 >> y2;
  cout << "vvedite koordinati tritei vershini x3 i y3: ";
  cin >> x3 >> y3;
  a = sqrt(pow((x2 - x1), 2.0) + pow((y2 - y1), 2.0));
  b = sqrt(pow((x3 - x2), 2.0) + pow((y3 - y2), 2.0));
  c = sqrt(pow((x1 - x3), 2.0) + pow((y1 - y3), 2.0));
  p = (a + b + c)/2;
  S = sqrt(p*(p - a)*(p - b)*(p - c));
  std::cout << "S = " << S <<endl;
  std::cout << "P = " << a + b + c <<endl;
  return 0;
}
